<template>
  <div class="tabbar">
    <div class="line" :class="getLineClass"></div>
    <ul>
      <li v-for="(e,i) in list" :key="i" :class="{active:getCurrent==i}" @click="modify(i)">
        {{e}}
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "TabBar",
  data() {
    return {
      list: ["校招动态","在招岗位","犀牛鸟精英计划"]
    };
  },
  computed: {
    getCurrent() {
      return this.$store.state.current;
    },
    getLineClass(){
      let lt = ['left','center','right']
      return lt[this.getCurrent]
      
    }
  },
  methods:{
    modify(i){
      this.$store.commit("modifyCurrent",i)
    }
  }
};
</script>
<style scoped>
.tabbar {
  min-width: 1024px;
  height: 80px;
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 9999;
}
.tabbar ul {
  width: 80%;
  height: 100%;
  display: flex;
  justify-content: center;
  margin: 0 auto;
}
.tabbar ul li {
  width: 33%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.5;
}
.tabbar ul li  {
  font-size: 1.6rem;
  color: white;
  cursor: pointer;
}
.tabbar ul > .active {
  opacity: 1;
  font-weight: 400;
}
/* line */
.tabbar > .line { 
  position: absolute;
  overflow: hidden;
  width: 26.5%;
  height: 4px;
  border-radius: 2px;
  background: #fff;
  top:-3px;
  right:63%;
  transition:400ms
}
.tabbar > .left{
  right:63%
}
.tabbar > .center{
  right:36.4%
}
.tabbar > .right{
  right:10%
}
</style>






</style>